package ytdp.careagle.com.ytdp.net;


import java.util.HashMap;
import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.HeaderMap;
import retrofit2.http.POST;
import ytdp.careagle.com.ytdp.app.G;
import ytdp.careagle.com.ytdp.entity.BaseConfig;
import ytdp.careagle.com.ytdp.entity.BrandRelationship;
import ytdp.careagle.com.ytdp.entity.LoginEntity;
import ytdp.careagle.com.ytdp.entity.ModelRelationship;
import ytdp.careagle.com.ytdp.entity.ProvinceEntity;
import ytdp.careagle.com.ytdp.entity.PushCarEntity;
import ytdp.careagle.com.ytdp.entity.QueryAllCarType;
import ytdp.careagle.com.ytdp.entity.SellCarProgramEntity;
import ytdp.careagle.com.ytdp.entity.SeriesRelationship;
import ytdp.careagle.com.ytdp.entity.SmsCodeIdEntity;
import ytdp.careagle.com.ytdp.entity.ValuationQuery;
import ytdp.careagle.com.ytdp.entity.VehicleSeries;
import ytdp.careagle.com.ytdp.entity.VersionControlEntity;

/**
 * 哒哒哒哒哒哒哒哒哒 ins
 * 版本号修改日期修改人修改内容
 */

public interface NetService {

    /**
     * 登录
     */
    @FormUrlEncoded
    @POST("http://" + G.DEVELOPE_VERSION + "/person/login")
    Observable<Result<LoginEntity>> goLogin(@FieldMap Map<String, String> map);

    /**
     * 登出
     */
    @FormUrlEncoded
    @POST("http://" + G.DEVELOPE_VERSION + "/api/v1/person/logout")
    Observable<Result> goLogout(@HeaderMap Map<String, String> headers, @FieldMap Map<String, String> map);

    /**
     * 获取验证码
     */
    @FormUrlEncoded
    @POST("http://" + G.DEVELOPE_VERSION + "/server/sms/companyCollector/sendForgotCode")
    Observable<Result<SmsCodeIdEntity>> getVerificationCode(@HeaderMap Map<String, String> headers, @FieldMap Map<String, String> map);

    /**
     * 重置密码
     */
    @FormUrlEncoded
    @POST("http://" + G.DEVELOPE_VERSION + "/server/sms/companyCollector/updatePassword")
    Observable<Result> resetPassword(@HeaderMap Map<String, String> header, @FieldMap HashMap<String, String> map);

    /**
     * 车品牌1
     */
    @GET("http://" + G.DEVELOPE_VERSION + "/api/v1/vehicle/brand")
    Observable<Results<BrandRelationship>> getBrandRelationship(@HeaderMap Map<String, String> header);

    /**
     * 车系
     */
    @FormUrlEncoded
    @POST("http://" + G.DEVELOPE_VERSION + "/api/v1/vehicle/series")
    Observable<Results<SeriesRelationship>> getRelationship(@HeaderMap Map<String, String> header, @FieldMap Map<String, String> map);


    @GET("http://" + G.DEVELOPE_VERSION + "/api/v1/vehicle/provinceCity")
    Observable<Results<ProvinceEntity>> getLocalProvinceCity(@HeaderMap Map<String, String> header);

    /**
     * 车型
     */
    @FormUrlEncoded
    @POST("http://" + G.DEVELOPE_VERSION + "/api/v1/vehicle/model")
    Observable<Results<ModelRelationship>> getModelRelationship(@HeaderMap Map<String, String> header, @FieldMap Map<String, String> map);

    /**
     * 估价查询
     */
    @FormUrlEncoded
    @POST("http://" + G.DEVELOPE_VERSION + "/api/v1/valuationQuery/queryValuationQuery")
    Observable<Result<ValuationQuery>> queryValuationQuery(@HeaderMap Map<String, String> header, @FieldMap Map<String, String> map);

    /**
     * 获取车型
     */
    @FormUrlEncoded
    @POST("http://" + G.DEVELOPE_VERSION + "/api/v1/valuationQuery/queryValuationQuery")
    Observable<Result> findByModelCode(@HeaderMap Map<String, String> header, @FieldMap Map<String, String> map);

    /**
     * 首页轮播广告
     */
    @GET("http://" + G.DEVELOPE_VERSION + "/api/v1/advertising/listByShop")
    Observable<Results<VehicleSeries>> getBanner(@HeaderMap Map<String, String> header);

    /**
     * 相关推荐
     */
    @FormUrlEncoded
    @POST("http://" + G.DEVELOPE_VERSION + "/api/v1/vehicleSeries/findVehicleSeriesByResidualvalue")
    Observable<Result<PushCarEntity>> findVehicleSeriesByResidualvalue(@HeaderMap Map<String, String> header, @FieldMap Map<String, String> map);

    /**
     * 发现车型
     */
    @FormUrlEncoded
    @POST("http://" + G.DEVELOPE_VERSION + "/api/v1/vehicleSeries/findVehicleByVehicleSeriesAndOnline")
    Observable<Results<SellCarProgramEntity>> findVehicleByVehicleSeriesAndOnline(@HeaderMap Map<String, String> header, @FieldMap Map<String, String> map);

    /**
     * 获取基础配置
     */
    @GET("http://" + G.DEVELOPE_VERSION + "/api/v1/basic/getBasicConfig")
    Observable<Result<BaseConfig>> getBasicConfig(@HeaderMap Map<String, String> header);

    /**
     * 获取经销商下所有车系列表
     */
    @GET("http://" + G.DEVELOPE_VERSION + "/api/v1/vehicleSeries/listVehicleSeriesByShop")
    Observable<Results<QueryAllCarType>> listVehicleSeriesByShop(@HeaderMap Map<String, String> header);

    /**
     * 获取车型参数配置详情
     */
    @FormUrlEncoded
    @POST("http://" + G.DEVELOPE_VERSION + "/api/v1/vehicleSeries/getVehicleModelParams")
    Observable<Results<List<String>>> getVehicleModelParams(@HeaderMap Map<String, String> header, @FieldMap Map<String, String> map);

    /**
     * 保存客户信息
     */
    @FormUrlEncoded
    @POST("http://" + G.DEVELOPE_VERSION + "/api/v1/customer/saveCustomer")
    Observable<Result> saveCustomer(@HeaderMap Map<String, String> header, @FieldMap Map<String, String> map);

    /**
     * 获取最新版本信息
     */
    @FormUrlEncoded
    @POST("http://" + G.DEVELOPE_VERSION + "/appVersion/queryLastAppInfo")
    Observable<Result<VersionControlEntity>> getCurrVersion(@FieldMap HashMap<String, String> map);

}
